<template>
    <div class="pageMain">
        <!-- 头部导航 -->
        <div class="header">
            <van-nav-bar title="物流信息" left-arrow @click-left="toBack" />
        </div>

        <div class="mainCon">

            <div class="info_box">
                <div>订单编号：{{ order_num }}</div>
                <div>快递公司：{{ order.com }}</div>
                <div class="orderNumBox">快递单号：{{ order.jsonString.LogisticCode }} <div @click="fuzhi" class="copyBtn">复制
                    </div>
                </div>
            </div>
            <div class="information_middle"></div>
            <div class="hovertree-trackrcol">
                <div class="hovertree-tracklist">
                    <ul id="a1" v-if="order.jsonString.Traces.length > 0">
                        <li v-for="(item, index) in order.jsonString.Traces" :key="index">
                            <i class="active"></i>
                            <span class="txt">{{ item.AcceptStation }}</span>
                            <span class="time">{{ item.AcceptTime }}</span>
                            <div class="null_border"></div>
                        </li>
                    </ul>
                    <div v-else class="noTip">暂无物流信息</div>
                </div>
            </div>


        </div>
    </div>

</template>

<script>

import { checkWuLiu } from '../../network/order'

export default {
    name: 'HomeR',
    data() {
        return {
            order_num: localStorage.order_num,
            order: {},

        }
    },
    mounted() {

    },
    methods: {
        getData: function () {
            checkWuLiu({
                orderNum: this.order_num
                // orderNum: 1704934772885
            }).then(res => {
                if (res.flag) {
                    res.data.jsonString = JSON.parse(res.data.jsonString)
                    this.order = res.data
                }
            })

        },
        fuzhi: function () {
            var oInput = document.createElement('input');
            oInput.value = this.order.jsonString.LogisticCode;
            document.body.appendChild(oInput);
            oInput.select(); // 选择对象;
            document.execCommand("Copy"); // 执行浏览器复制命令
            this.$toast("复制成功");
            oInput.remove();
        },
        toBack() {
            this.$router.go(-1)
        },

    },
    created() {
        this.getData()
    },
    //计算属性
    computed: {

    },
    filters: {

    }

}

</script>

<style lang='less' scoped>
.mainCon {
    position: relative;
    top: 148px;
}

.header .van-icon {
    color: #333;
    font-size: 40px;
    font-weight: bold;
}

.header .van-nav-bar__text {
    color: #333;
}

.header {
    position: fixed;
    z-index: 10;
    width: 100%;
    height: 88px;
    background-color: #fff;
    padding-top: 60px;
}

/deep/.van-nav-bar__text,
/deep/.van-nav-bar__left,
/deep/.van-nav-bar .van-icon {
    color: #333;
}



.hovertree-tracklist ul li {
    list-style: none;
}

.hovertree-tracklist {
    margin: 40px;
    margin-left: 0;
    position: relative;
}

.hovertree-tracklist li {
    position: relative;
    padding: 18px 0 18px 50px;
    line-height: 40px;
    border-left: 2px solid #d2d2d2;
    color: #999;
}

.hovertree-tracklist li.first {
    padding-top: 0;
}

.hovertree-tracklist li .node-icon {
    position: absolute;
    left: -10px;
    top: 28px;
    width: 20px;
    height: 20px;
    background: url(../../assets/order/default.png);
    background-size: 100% 100%;
}

.active {
    position: absolute;
    left: -22px;
    top: 0%;
    width: 40px;
    height: 36px;
    background: url(../../assets/order/active.png);
    background-size: 100% 100%;
}

.hovertree-tracklist li .time {
    margin-right: 40px;
    position: relative;
    top: 8px;
    display: block;
    vertical-align: middle;
    color: #969696;
}

.hovertree-tracklist li .txt {
    max-width: 1200px;
    position: relative;
    display: block;
    vertical-align: middle;
    font-weight: bold;
    color: #333;
}

.null_border {
    width: 100%;
    height: 30px;
    border-bottom: 2px solid #d2d2d2;
}

.info_box {
    border-bottom: 20px solid #f5f5f5;
}

.info_box div {
    padding: 20px 40px;
}

.mui-bar a {
    color: #333;
}

.mui-bar {
    background: #FFFFFF;
}

.noTip {
    padding: 40px 0;
    font-size: 28px;
    color: #666;
    text-align: center;
    width: 100%;
}

.noTip1 {
    padding-left: 40px;
    padding-top: 80px;
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
}

.empImg {
    width: 374px;
    height: 276px;
}

.noTip1>span {
    font-size: 28px;
    color: #999;
}

.copyBtn {
    margin-left: 28px;
    padding: 0px !important;
    font-size: 28px;
    color: #4C88FA;
}

.orderNumBox {
    display: flex;
    align-items: center;
}
</style>